import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
// 导入vuex持久化
import persistedstate from 'vuex-persistedstate'
Vue.use(Vuex)
const store = new Vuex.Store({
  modules: {
    user
  },
  plugins: [
    persistedstate({
      paths: ['user.token', 'user.userinfo']
    }) // 默认是所有的vuex数据持久化
  ]
})

export default store
